package com.zxy.controller;

import com.zxy.service.Test2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    Test2Service test2Service;

    @GetMapping("/helloworld")
    public String helloworld() {
        return "helloworld";
    }

    @GetMapping("/workStatus")
    public String workStatus() {
        return "工作状态:" + test2Service.isWork();
    }

    @GetMapping("/startWork")
    public String startWork() {
        test2Service.startWork();
        return "startWork";
    }

    @GetMapping("/stopWork")
    public String stopWork() {
        test2Service.stopWork();
        return "stopWork";
    }

}
